#include "AbstractFileFormat.h"

/**
 *  Default constructor
 **/
AbstractFileFormat::AbstractFileFormat(PFSInfo info) {
    this->created = false;

    this->sizeParam = DEFAULT_FILESIZE_PARAM;

    this->readWriteMode = info->rwMode;
    this->readMode		= info->readMode;
    this->writeMode		= info->writeMode;
    this->appendMode	= info->appendMode;
	this->truncateMode	= false;
}

/**
 *
 **/
AbstractFileFormat::~AbstractFileFormat(){
}


int AbstractFileFormat::truncate(PFSInfo info)
{
	PMemoryFile file = info->filesystem->getMemoryFile(info->path, info->isCache);

    if(file != NULL) {
        file->size = 0;
		this->truncateMode = true;
    }
	return 0;
}
